const path = require("path");

module.exports = [
    {
        entry: {
            main: "./src/index.ts",
        },
        output: {
            path: path.resolve(__dirname, "dist"),
            filename: "bundle.js",
        },
        stats: {
            colors: true,
            preset: "minimal",
        },
        devtool: "source-map",
        resolve: {
            extensions: [".ts", ".js"],
        },
        module: {
            rules: [
                {
                    test: /\.tsx?$/,
                    loader: "ts-loader",
                },
            ],
        },
    },
    {
        entry: {
            main: "./editor/index.ts",
        },
        target: "electron-renderer",
        stats: {
            colors: true,
            preset: "minimal",
        },
        mode: "development",
        output: {
            path: path.resolve(__dirname, "dist"),
            filename: "editor.js",
        },
        externals: {
            'ws': "require('ws')"
        },
        devtool: "source-map",
        resolve: {
            extensions: [".ts", ".js"],
        },
        module: {
            rules: [
                {
                    test: /\.tsx?$/,
                    loader: "ts-loader",
                },
            ],
        },
    },
];
